package com.homeproject.trailservice.domain.relationship;


import com.homeproject.trailservice.domain.Customer;
import com.homeproject.trailservice.domain.Fruite;
import com.homeproject.trailservice.domain.SubOrder;
import lombok.*;
import org.glassfish.jersey.internal.inject.Custom;
import org.neo4j.ogm.annotation.EndNode;
import org.neo4j.ogm.annotation.RelationshipEntity;
import org.neo4j.ogm.annotation.StartNode;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;

/**
 * Within a community group purchase, there are following entities and relationships
 *
 * Customer - submit -> SubOrder
 * GroupManager - Initiate -> Order
 * Fruit - PartOf -> Order
 * Vegetable - PartOf -> Order
 * Provider - Prepare -> Order
 * Deliverer - Deliver -> Order
 * Deliverer - WorksFor -> DeliveryCompany
 * */

@RelationshipEntity(type = "Submit")
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@Setter
@Data
public class Submit {
    @Id
    @GeneratedValue
    protected long id;

    @StartNode
    private Customer customer;

    @EndNode
    private SubOrder subOrder;
}
